package com.config.tomcat.lifecycle;

import org.apache.catalina.Context;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;

/**
 * @author chengyadong
 * @date 2023/9/21 17:01
 * @description context声明周期监听器
 */
public class ContextLifecycleListener implements LifecycleListener {
	@Override
	public void lifecycleEvent(LifecycleEvent event) {
		Context context = (Context) event.getLifecycle();
		if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
			System.out.println("开始接受context组件发布的configure_start事件：="+context.getDisplayName());
		}
	}
}
